//
//  LCPlaylistManager.m
//  LC
//
//  Created by admin on 16/12/16.
//  Copyright © 2016年 admin. All rights reserved.
//

#import "LCPlaylistManager.h"
#import "NSString+JSON.h"
#import "LCPlaylist.h"

#import "JKSongsMessResult.h"
#import "JKSongsMessStatus.h"

@implementation LCPlaylistManager {
    NSMutableArray<LCPlaylist *>  *_playlists;
}

IMPLEMENTATION_SINGLETON(LCPlaylistManager)

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        // 初始化代码
        _playlists = [NSMutableArray array];
        
    }
    return self;
}

#pragma mark - 播放列表管理 -
// 获取所有的播放列表
- (NSArray<LCPlaylist *>*)allPlaylists {
    return _playlists;
}

// 添加播放列表
- (void)addPlaylist:(LCPlaylist *)playlist {
    if(playlist == nil) return;
    [_playlists addObject:playlist];
}

// 删除播放列表通过索引
- (void)removeAllPlaylists {
    [_playlists removeAllObjects];
}

// 删除播放列表通过索引
- (void)removePlaylistAtIndex:(NSUInteger)index {
    if(_playlists.count == 0 || index >= _playlists.count) return;
    [_playlists removeObjectAtIndex:index];
}


@end
